package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name="李四";
        int age=20;
        String gender="女";
        String[]otherInfo={"是个医生","是个院长","是个母亲","更是个妻子"};

        Student ls=new Student(name,age,gender,otherInfo);
        System.out.println(ls);

        FileOutputStream fos=new FileOutputStream("aaaa.txt");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(ls);
        System.out.println("已经完毕");
        oos.close();
    }
}
